package com.kensure.shike.user.model;

import java.util.Date;

import co.kensure.frame.BaseInfo;

import com.kensure.shike.user.service.SKRoleService;
import com.kensure.shike.zhang.model.SKUserYue;

/**
 * 用户表对象类
 * 
 * @author fankd created on 2018-9-2
 * @since
 */
public class SKUser extends BaseInfo {

	private static final long serialVersionUID = 3545276994084105527L;

	/***/
	private Long id;

	/** 手机号 */
	private String phone;

	/** 推荐人ID */
	private Long refereeId;

	/** 等级编码 */
	private String levelCode;

	/** 状态,0正常，-1停用 */
	private Integer status;

	/** 用户姓名 */
	private String nickname;

	/** 支付宝账号 */
	private String noAlipay;

	/** 支付宝截图 */
	private String alipayImg;

	/** 微信账号 */
	private String noWeixin;
	
	/** 微信头像url */
	private String topImg;
	
	/** 邀请码 */
	private String code;

	/** 真实姓名 */
	private String realname;

	/** 第一次完成消费的时间 */
	private Date firstShoptime;
	/** 微信openid */
	private String openid;
	/** 微信session_key */
	private String sessionKey;
	/** 购买次数 */
	private Integer gmcs;
	
	/** 成员人数*/
	private Integer chengyuan;
	/** 会员人数 */
	private Integer huiyuan;
	
	/** 用户余额 */
	private SKUserYue yue;
	
	/** 邀请人 */
	private SKUser ref;
	
	/** 最近购买时间 */
	private Date lastGmtime;
	
	/** 成为vip的时间 */
	private Date vipTime;
	
	/**
	 * 存放产生的对象
	 */
	private SKUserChanChu chanchu;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Long getRefereeId() {
		return refereeId;
	}

	public void setRefereeId(Long refereeId) {
		this.refereeId = refereeId;
	}

	public String getLevelCode() {
		return levelCode;
	}

	public void setLevelCode(String levelCode) {
		this.levelCode = levelCode;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getNoAlipay() {
		return noAlipay;
	}

	public void setNoAlipay(String noAlipay) {
		this.noAlipay = noAlipay;
	}

	public String getAlipayImg() {
		return alipayImg;
	}

	public void setAlipayImg(String alipayImg) {
		this.alipayImg = alipayImg;
	}

	public String getNoWeixin() {
		return noWeixin;
	}

	public void setNoWeixin(String noWeixin) {
		this.noWeixin = noWeixin;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public Date getFirstShoptime() {
		return firstShoptime;
	}

	public void setFirstShoptime(Date firstShoptime) {
		this.firstShoptime = firstShoptime;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getSessionKey() {
		return sessionKey;
	}

	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}

	public Integer getGmcs() {
		return gmcs;
	}

	public void setGmcs(Integer gmcs) {
		this.gmcs = gmcs;
	}

	public Date getLastGmtime() {
		return lastGmtime;
	}

	public void setLastGmtime(Date lastGmtime) {
		this.lastGmtime = lastGmtime;
	}

	public SKUserChanChu getChanchu() {
		return chanchu;
	}

	public void setChanchu(SKUserChanChu chanchu) {
		this.chanchu = chanchu;
	}
	
	public String getLevelCodeDesc() {
		String des = "非会员";		
		if(levelCode != null){
			SKRole role = SKRoleService.selectRoleByCode(levelCode);
			if(role != null){
				des = role.getName();
			}
		}
		return des;
	}

	public Integer getChengyuan() {
		return chengyuan;
	}

	public void setChengyuan(Integer chengyuan) {
		this.chengyuan = chengyuan;
	}

	public Integer getHuiyuan() {
		return huiyuan;
	}

	public void setHuiyuan(Integer huiyuan) {
		this.huiyuan = huiyuan;
	}

	public SKUserYue getYue() {
		return yue;
	}

	public void setYue(SKUserYue yue) {
		this.yue = yue;
	}

	public SKUser getRef() {
		return ref;
	}

	public void setRef(SKUser ref) {
		this.ref = ref;
	}

	public Date getVipTime() {
		return vipTime;
	}

	public void setVipTime(Date vipTime) {
		this.vipTime = vipTime;
	}

	public String getTopImg() {
		return topImg;
	}

	public void setTopImg(String topImg) {
		this.topImg = topImg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
}
